<?php 
$user=$session->read('User');
$companyid=$session->read("companyid");
$isflag=$action->checkPermissions($user,$companyid);
?>
<div class="right_side_operate_area">
	<div class="right_side_title left">
		<h2><?php echo $form->value('Company.company_name');?></h2>
	</div>
    <div class="right back_btn">
    <?php 
	    if($user['cid']){
	    	echo $html->link("编辑","/companys/editinfo/".$user['cid']);
	    }
	    else{
	    	echo $html->link("返回","/companys/index/",array("onclick"=>"history.go(-1);return false;"));
	    }
    ?>
    </div>
    <div class="clear"></div>
</div>
<div class="right_side_scollbar">
    <div class="detail_info_panel">
    	<?php echo $form -> create('companys', array('url' => '/companys/editinfo/','enctype'=>'multipart/form-data','type'=> 'post','onsubmit'=>'return checksave()') ); ?>
         <div class="details_item_line">
             <div class="details_item">
                <div class="form_left_title left">企业Logo：</div>
                <div class="form_right_input left">
                <?php 
                $logoimg=$logo["file_path"];
                if($logoimg){
                	echo $html->image("/".$logoimg,array("width"=>"200px","height"=>"80px"));
                } else 
	                	echo "暂无图片";
                ?>
                </div>
       		</div>
       	</div>
        <div class="details_item_line">
             <div class="details_item">
                <div class="form_left_title left"><?php __("Company Name")?>：</div>
                <div class="form_right_input left"><?php echo $form->value('Company.company_name');?></div>
            </div>
        </div>
        <div class="details_item_line">
            <div class="details_item">
            	 <div class="form_left_title left">所属产业：</div>
            	 <div class="form_right_add left">
                	<?php 
		            $industryidlist="";
		            if($pros_cvalues){
			            foreach($pros_cvalues as $pros_cvalue){
			            	if(!empty($pros_cvalue["cvid"])){
			            		$industryidlist.=$pros_cvalue["cvid"].',';
			            	}
			            }
		            }
		            ?>
		            <div id="pcvalueidlist" class="txthide"><?php echo $industryidlist?></div>
                	<div id="taglist" class="added_item_list left"></div>
                    <div class="add_item_btn left">
		                <div id="add_float_box" class="add_float_box" style="display:none;">
		                    <ul>
			                    <?php 
			                    $dan="'";
			                    foreach($industrys as $key=>$industry){
									echo "<li><label>";
									echo '<input type="checkbox" id="chbox'.$key.'" onclick="settxt(this,'.$dan.$industry.$dan.','.$dan."#ProjectIndustryname".$dan.','.$dan."#ProjectIndustryid".$dan.','.$dan."#taglist".$dan.')" value="'.$key.'" />'.$industry;
									echo "</label></li>";
									echo "<span id='span".$key."' class='txthide'>".$industry."</span>";
								}?> 
							</ul>
		                </div>
					</div>
                    <?php echo $form->text('Project.industryname',array('class'=>'txthide','readonly'=>'true','style'=>'width:500px'));?>
		            <?php echo $form->text('Project.industryid',array('class'=>'txthide'));?>
                </div>
            </div>
        </div>
        <div class="details_item_line">
            <div class="details_item">
            	 <div class="form_left_title left">企业类型：</div>
            	 <div class="form_right_add left">
                	<?php 
		            $ctypeidlist="";
		            if($companytypes){
			            foreach($companytypes as $companytype){
			            	if(!empty($companytype["cvid"])){
			            		$ctypeidlist.=$companytype["cvid"].',';
			            	}
			            }
		            }
		            ?>
		            <div id="comptypeidlist" class="txthide"><?php echo $ctypeidlist?></div>
                	<div id="taglistct" class="added_item_list left"></div>
                    <div class="add_item_btn left">
		                <div id="add_float_boxct" class="add_float_box" style="display:none;">
		                    <ul>
			                    <?php 
			                    $dan="'";
			                    foreach($ctypes as $key=>$ctype){
									echo "<li><label>";
									echo '<input type="checkbox" id="chbox'.$key.'" onclick="settxt(this,'.$dan.$ctype.$dan.','.$dan."#ProjectCompanytypename".$dan.','.$dan."#ProjectCompanytypeid".$dan.','.$dan."#taglistct".$dan.')" value="'.$key.'" />'.$ctype;
									echo "</label></li>";
									echo "<span id='span".$key."' class='txthide'>".$ctype."</span>";
								}?> 
							</ul>
		                </div>
					</div>
                    <?php echo $form->text('Project.companytypename',array('class'=>'txthide','readonly'=>'true','style'=>'width:500px'));?>
		            <?php echo $form->text('Project.companytypeid',array('class'=>'txthide'));?>
                </div>
            </div>
        </div>
        <div class="details_item_line">
            <div class="details_item">
                <div class="form_left_title left"><?php __("Regedit Time")?>：</div>
                <div class="form_right_input left"><?php echo $form->value('Company.reg_time');?></div>
            </div>
            <div class="details_item">
                <div class="form_left_title left"><?php __("Regedit Capital")?><span class="captype">(万)</span>：</div>
                <div class="form_right_input left">
	                <?php echo $form->value('Company.cap_type')=="0"?"￥":"＄"?>
	                <?php echo $form->value('Company.capital');?>
                </div>
            </div>
             <div class="details_item">
                <div class="form_left_title left">资金到位：</div>
                <div class="form_right_input left"><?php echo $form->value('Company.is_funds')?"是":"否";?></div>
            </div>
        </div>
        <div class="details_item_line">
            <div class="details_item">
                <div class="form_left_title left">入驻时间：</div>
                <div class="form_right_input left"><?php echo $form->value('Company.resident_time');?></div>
            </div>
            <div class="details_item">
                <div class="form_left_title left">落户位置：</div>
                <div class="form_right_input left"><?php echo $form->value('Company.address');?></div>
            </div>
            <div class="details_item">
                <div class="form_left_title left">孵化面积：</div>
                <div class="form_right_input left">
                	<?php echo $form->value('Company.size');?>
                	平方米
                </div>
            </div>
        </div>
        <div class="details_item_line">
            <div class="details_item">
                <div class="form_left_title left">负责人：</div>
                <div class="form_right_input left"><?php echo $form->value('Company.contact');?></div>
            </div>
            <div class="details_item">
                <div class="form_left_title left"><?php __("Tel")?>：</div>
                <div class="form_right_input left"><?php echo $form->value('Company.tel');?></div>
            </div>
            <div class="details_item">
                <div class="form_left_title left"><?php __("Mail")?>：</div>
                <div class="form_right_input left"><?php echo $form->value('Company.email');?></div>
            </div>
        </div>
        <div class="details_item_line">
        	<div class="details_item">
                <div class="form_left_title left">高企认定：</div>
                <div class="form_right_input left">
                  <?php echo $form->value('Company.is_height')?"是":"否";?>
                </div>
            </div>
        </div>
     <div class="details_item_line">  
            <div class="details_item">
                <div class="form_left_title left"><?php echo "电子材料" ;?>：</div>
                <div class="left">
                	<div class="file_category_list">
		        		<div id="filelist0" class="file_lists">
		        			<?php $dan="'";
			                	if($attachments){?>
		        			<ul class="picture_attach">
		        				<?php
			                	foreach($attachments as $attachment){
			                			$fname=$attachment["file_name"];
			                			$fpath=$attachment["file_path"];
			                			$fid=$attachment["id"];
			                			$createdtime=date("Y-m-d",strtotime($attachment["created"]));
			                			$isimg=$str->checkimg($fname);
			                			if($isimg){
											echo "<li>";
											echo '<div class="picture_info">';
											echo "<span>".$fname."</span>";
											echo "<span class='source_upload_date'>".$createdtime.$html->link("下载",'/projects/download/'.$attachment["id"],null)."</span>";
											echo "</div>";
											if($isflag){
												echo '<span class="source_upload_delete"><a title="删除" onclick="delfile(this,'.$dan.$attachment["id"].$dan.',0)" href="javascript:void(0)"></a></span>';
											}
											$img=$html->image("/".$fpath);
											echo "<span>".$html->link($img,'javascript:void(0);',array('onclick'=>"openimg(".$dan."f".$fid.$dan.")",'escape' => false))."</span>";
											echo "<div style='display:none' id='f".$fid."' title='".$fname."'>".$img."</div>";
											
											echo "</li>";
										}
									}
			                	?>
		        				<div class="clear"></div>
		        			</ul>
		        			<ul class="file_attach">
			                	<?php
			                	foreach($attachments as $attachment){
			                			$fname=$attachment["file_name"];
			                			$isimg=$str->checkimg($fname);
			                			if(!$isimg){
											echo "<li>";
											echo "<span>".$html->link($fname,'/projects/download/'.$attachment["id"],null)."</span>";
											echo "<span class='source_upload_date'>".date("Y-m-d",strtotime($attachment["created"]))."</span>";
											if($isflag){
												echo '<span class="source_upload_delete"><a title="删除" onclick="delfile(this,'.$dan.$attachment["id"].$dan.',0)" href="javascript:void(0)"></a></span>';
											}
											echo "</li>";
										}
									}
			                	?>
			                	<div class="clear"></div>
			                </ul>
			                <?php 
			                	}else{
									echo '<div class="form_right_input left">暂无文件</div>';
								}
			                ?>
		                </div>
		             </div>
				</div>
            </div>
        </div>
        </form>
    </div>
</div>
<?php echo $this->element('delfileconfirm',array("title"=>"删除提示","message"=>"你确定要删除吗？")) ?>
<?php echo $javascript->link('project.js');?>